<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>用户登录</title>
        <link rel="stylesheet" type="text/css" href="css/public.css">
        <link rel="stylesheet" type="text/css" href="css/register.css">
        <link type="text/css" href="css/public.css" rel="stylesheet" />
		<link type="text/css" href="css/index.css" rel="stylesheet" />
		<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
		<link type="text/css" rel="stylesheet" href="css/owl.carousel.min.css">
		<link type="text/css" rel="stylesheet" href="css/animate.min.css">
		<link type="text/css" rel="stylesheet" href="css/nice-select.css">
		<link type="text/css" rel="stylesheet" href="css/themify-icons.css">
		<link type="text/css" rel="stylesheet" href="css/magnific-popup.css">
		<link type="text/css" rel="stylesheet" href="css/meanmenu.css">
		<link type="text/css" rel="stylesheet"
			href="css/fontawesome-all.min.css">
		<link type="text/css" rel="stylesheet" href="css/slick.css">
		<link type="text/css" rel="stylesheet" href="css/default.css">
		<link type="text/css" rel="stylesheet" href="css/style.css">
		<link type="text/css" rel="stylesheet" href="css/responsive.css">
    </head>
    <body>
    	<c:if test="${user.user_name!=null}">
    		<% response.sendRedirect("index.jsp"); %>
    	</c:if>
        <jsp:useBean id="user" scope="session" class="vo.Person"></jsp:useBean>
	<jsp:useBean id="menuBean" scope="page" class="vo.Menu"></jsp:useBean>
	<jsp:useBean id="introduceBean" scope="page" class="vo.Introduce"></jsp:useBean>

	<!-- header-start -->
	<header>
		<div id="sticky-header" class="header-top-area header-2 pr-60 pl-60">
			<div class="container-fluid">
				<div class="row">
					<div class="col-xl-3 col-lg-2">
						<div class="logo">
							<c:choose>
								<c:when test="${user.user_name!=null}">
									<a href="UserExitServlet"><span>【退出】</span></a>
									<span>欢迎您：<c:out value="${user.user_name}"></c:out></span>
								</c:when>
								<c:otherwise>
									<a href="register.jsp"><span>【注册】</span></a>
									<a href="register.jsp"><span>【登录】</span></a>
								</c:otherwise>
							</c:choose>
						</div>
					</div>
					<div class="col-xl-6 col-lg-8">
						<div class="main-menu text-center">
							<nav id="mobile-menu">
								<ul>
									<li class="active"><a href="index.jsp">首页</a></li>
									<li><a href="about.jsp">关于我们</a></li>
									<li><a href="shopping.jsp">我的购物车</a></li>
									<li><a href="order_search.jsp">订单查询</a></li>
									<li><a href="MemberServlet">会员管理中心</a></li>
								</ul>
							</nav>
						</div>
						<div class="mobile-menu"></div>
					</div>
					<div class="col-xl-3 col-lg-2">
						<div class="header-right f-right d-none d-md-none d-lg-block">
							<ul>
								<li><a href="#" data-toggle="modal"
									data-target="#search-modal"><span class="ti-search"></span></a>
								</li>
								<li><a href="shopping.jsp"><span class="ti-shopping-cart"></span></a></li>
								<li class="info-bar"><a href="#"><span
										class="ti-align-right"></span></a></li>
							</ul>
						</div>
					</div>

				</div>
			</div>
		</div>
	</header>
	<div class="indx_main_body" align="center">
                <div class="index_header">
                    <div class="index_tab_nav">
                        <div class="name">
                            <a href="#" id="signup">注册</a>
                            <a href="#" id="signin">登录</a>
                        </div>
                    </div>
                    <div class="signup">
                    <table style="border-collapse:separate; border-spacing:0px 10px;">
                    <form class="form" name="signupForm" action="UserRegisterServlet" method="post" onsubmit="return validateSignUp()">
                            <tr><td><div><span class="name">用户名：</span></td>
                            <td><input type="text" name="username" placeholder="姓名" maxlength="30" id="username"/></div></td></tr>
                            <tr><td><div><span class="name">密码：</span></td>
                            <td><input type="password" name="password" placeholder="请输入不少于6为字符" maxlength="30" id="password"/></div></td></tr>
                            <tr><td><div><span class="name">确认密码：</span></td>
                            <td><input type="password" name="password2" placeholder="确认密码" id="password2"/></div></td></tr>
                            <tr><td><div><span class="name">性别：</span></td>
                            <td><input type="radio" name="sex" value="男" checked="checked"/><span>男</span><input type="radio" name="sex" value="女"/><span>女</span></div></td></tr>
                            <tr><td><div><span class="name">真实姓名：</span></td>
                            <td><input type="text" name="realname" placeholder="真实姓名" id="realname"/></div></td></tr>
                            <tr><td><div><span class="name">E-mail：</span></td>
                            <td><input type="text" name="email" placeholder="请输入正确的电子邮件" id="email"/></div></td></tr>
                            <tr><td colspan=2 align="center"><div><span class="name"></span><input type="submit" value="立即注册" name="提交"/></span></td>
                            <td></td></tr>
                        </form>
                    </table>
                        
                    </div>
                    <div class="signin" style="display: none;">
                    <table style="border-collapse:separate; border-spacing:0px 10px;">
                    <form class="form" name="signinForm" action="UserLoginServlet" method="post" onsubmit="return validateSignIn()">
                            <tr><td><div><span class="name">用户名：</span></td>
                            <td><input type="text" name="username" placeholder="请输入用户名" id="username2"/></div></td></tr>
                            <tr><td><div><span class="name">密码：</span></td>
                            <td><input type="password" name="password" placeholder="请输入密码" id="password3"/></div></td></tr>
                            <tr><td></td>
                            <td colspan="2"><div><span class="name1"><input type="submit" value="登录"/>&nbsp<input type="reset" value="重置"/></span></div></td></tr>
                            <tr><td><div><a href="find_psw.jsp"><span class="name1">忘记密码?</td>
                            <td></span></div></td></tr>
                  
                        </form>
                     </table>
                    </div>
                </div>
            </div>
        </div>
        <script src="js/jquery-3.1.1.min.js"></script>
        <script type="text/javascript">
        	$('#signup').click(function(){
        		$('.signup').css('display', 'block');
        		$('.signin').css('display', 'none');
        	});
        	$('#signin').click(function(){
        		$('.signin').css('display', 'block');
        		$('.signup').css('display', 'none');
        	});
        	
        	function validateSignUp(){
        		var password = document.getElementById('password').value;
        		var password2 = document.getElementById('password2').value;
        		if (password != password2){
        			alert('两次密码输入不一致！');
        			return false;
        		} else {
        			return true;
        		}
        	}
        	function validateSignIn(){
        		var username = document.getElementById('username2').value;
        		var password = document.getElementById('password3').value;
        		if (username == ""){
        			alert('用户名不能为空！');
        			return false;
        		}
        		if (password == ""){
        			alert('密码不能为空！');
        			return false;
        		}
        	}
        </script>
     <!-- brand-area-start -->
		<div class="brand-area yellow-bg pt-75 pb-75">
			<div class="container">
				<div class="row justify-content-between">
					<div class="brand-active owl-carousel">
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/1.png" alt="" />
								</div>
							</div>
						</div>
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/2.png" alt="" />
								</div>
							</div>
						</div>
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/3.png" alt="" />
								</div>
							</div>
						</div>
						<div class="col-xl-12">
							<div class="brand-wrapper">
								<div class="brand-img">
									<img src="img/brand/4.png" alt="" />
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- brand-area-end -->
	<!-- JS here -->
	<script src="js/vendor/modernizr-3.5.0.min.js"></script>
	<script src="js/vendor/jquery-1.12.4.min.js"></script>
	<script src="js/waypoints.min.js"></script>
	<script src="js/jquery.counterup.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/owl.carousel.min.js"></script>
	<script src="js/isotope.pkgd.min.js"></script>
	<script src="js/jquery.nice-select.min.js"></script>
	<script src="js/jquery.meanmenu.min.js"></script>
	<script src="js/slick.min.js"></script>
	<script src="js/ajax-form.js"></script>
	<script src="js/wow.min.js"></script>
	<script src="js/jquery.scrollUp.min.js"></script>
	<script src="js/imagesloaded.pkgd.min.js"></script>
	<script src="js/jquery.magnific-popup.min.js"></script>
	<script src="js/plugins.js"></script>
	<script src="js/main.js"></script>        
    </body>
</html>